<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    .main,
    .left,
    .right {
      height: 100px;
      float: left;
    }
    .wrap {
      padding: 0 200px 0 300px;
    }
    /* 解决float 的父级元素高度塌陷 */
    .wrap::after {
      content: "";
      clear: both;
      display: block;
    }
    .main {
      background-color: red;
      width: 100%;
    }
    .left {
      background-color: green;
      width: 300px;
      position: relative;
      left: -300px;
      /* 这个 100% 是父级宽度的百分百 */
      margin-left: -100%;
    }
    .right {
      background-color: blue;
      position: relative;
      width: 200px;
      right: -200px;
      margin-left: -200px;
    }
    @media only screen and (max-width: 1000px) {
      .wrap {
        padding: 0;
      }
      .left {
        left: 0;
        margin-left: 0;
      }
      .right {
        margin-left: 0;
        right: 0;
      }
    }
  </style>
  <body>
    <div class="wrap">
      <main class="main">main</main>
      <aside class="left">left</aside>
      <aside class="right">right</aside>
    </div>
    <div style="height: 110px; background-color: pink">哈哈哈哈</div>
  </body>
</html>
